import lxml
from database import Database
class ECReader(object):
    #class used for reading data from eve-central
    def __init__(self,ecurl = None):
        if not ecurl:
            self.ecurl = "http://api.eve-central.com/api/marketstat"
            #
            #    eve-central api takes following params:
            #    hours - Statistics from the last X specified hours.
            #    typeid - (Required!)The type ID of the item you are requesting. I.e., 34 for Tritanium. Can be specified more than once
            #    minQ - The minimum quantity in an order to consider it for the statistics
            #    regionlimit - Restrict statistics to a region. Can be specified more than once.
            #    usesystem - Restrict statistics to a system.
            #
            
            #we don't want to overload eve-central, so we need to cache query results
            self.xmlCacheDir = "~/.eve-helper/cache"
        else:
            self.ecurl = ecurl
        self.db = Database()
    def fetchPrices(self,items,minQ = None,region = None,solarsystem = None):
        itemIds = db.getItemIds(items)
        pass
    